package net.dgg.zz.credential.guidePriceConfigure.dao;


import net.dgg.zz.credential.guidePriceConfigure.entity.GuidePriceConfigure;
import net.dgg.zz.credential.guidePriceConfigure.vo.GuidePriceVo;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;

import java.util.List;
import java.util.Map;

@Component
public interface GuidePriceConfigureDao {
    int deleteByPrimaryKey(Long id);

    int insert(GuidePriceConfigure record);

    int insertSelective(GuidePriceConfigure record);

    GuidePriceConfigure selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(GuidePriceConfigure record);

    int updateByPrimaryKey(GuidePriceConfigure record);

    /*
     * @Author zsx
     * @Date 2018-08-17 05:08:31
     * @Description 根据证书编码和时间查询指导价配置
     * @param certificateCode 证书编码
     * @param month 年月
     * @return GuidePriceConfigure
     */
    GuidePriceConfigure selectByCodeAndMonth(@Param("certificateCode") String certificateCode, @Param("month") String month, @Param("signOrgId") Long signOrgId);

    /*
     * @Author zsx
     * @Date 2018-08-17 05:08:47
     * @Description  分页查询指导价
     * @param params
     * @return List<Map>
     */
    List<GuidePriceVo> selectuidePriceByWithPage(Map<String, Object> params);

    /**
     * 计算指导价
     *  @param params
     *
     */
    Map countGuidePrice(Map params);

    /*
     * @Author zsx
     * @Date 2018-08-21 06:08:24
     * @Description 根据事业部id和如期查询当月是否存在配置
     */
    List<GuidePriceConfigure> selectBySignOrgIdAndMonth(@Param("signOrgId") Long signOrgId, @Param("month") String month);

    /*
     * @Author zsx
     * @Date 2018-08-21 07:08:43
     * @Description 根据事业部id和时间查询当月指导价配置条数
     */
    int selectGuidPriceCount(@Param("signOrgId") Long signOrgId, @Param("month") String month);

    /*
     * @Author zsx
     * @Date 2018-08-21 08:08:17
     * @Description 根据事业部id和日期删除数据
     */
    int deleteBySignOrgIdAndMonth(@Param("signOrgId") Long signOrgId, @Param("month") String month);

    /*
     * @Author zsx
     * @Date 2018-08-22 09:08:27
     * @Description 批量插入数据
     */
    int insertGuidePriceConfig(@Param("priceConfigures") List<GuidePriceConfigure> priceConfigures);
}